from PIL import Image
import zipfile
file = zipfile.ZipFile("monkey_moon.zip", "r")
file.extractall()
img_1 = Image.open("monkey.jpg")
img_2 = Image.open("moon.jpg")
pixels_1 = img_1.load()
w, h = img_1.size
for x in range(w):
    for y in range(h):
        r, g, b = pixels_1[x, y]
        pixels_2 = img_2.load()
        k = (r + g + b) / 3
        if b > k * 0.9:
            pixels_1[x, y] = pixels_2[x, y]
img_1.show()
img_1.save("monkey_moon.jpg", "JPEG")
